<template>
	<view style="padding: 5px 10px;">
	    <view class="flex-row" style="width: 280px;  background-color: white; border-radius: 10px; padding: 10px 15px;">
	    	<view class="" style="width: 80px; height: 80px; ">
	    		<image :src="getImageUrl()" style="width: 80px; height: 80px;" mode=""></image>
	    	</view>
	    	
	    	<view class="" style="margin-left: 15px;">
	    		<view class="" style="font-size: 15px; font-weight: 500;">
	    			{{dataModel.title}}
	    		</view>
				
				<view class="subTextColor" style="font-size: 15px;margin-top: 10px;">
					{{dataModel.description}}
				</view>
	    	</view>
	    </view>
		<!-- <view class="lineView lineColor"  >
			
		</view> -->
	</view>
</template>

<script>
	
	export default {
		props: {
			dataModel:{}
		},
		data() {
			return {
			}
		},
		
		methods: {
			getDateStr(){
				return this.$publicApi.dateToStr(parseInt(this.dataModel.releaseTime));
			},
			getImageUrl(){
				if(this.dataModel.resourceImages.length > 0){
					var url = this.dataModel.resourceImages[0];
					return url;
				} else {
					var map = this.getIconType(this.dataModel.originalLinkContent)
					return map.iconUrl;
				}
			},
			getIconType(str){
				 var map ={
					 typeName:'未知链接',
					 iconUrl:'https://mp-35bd1c1b-8095-44b6-b494-c65e6d85fd9c.cdn.bspapp.com/appConfigure/未知icon.jpg',
				 }
				if(str.includes('baidu.com')){
					map.typeName = '百度网盘'
					map.iconUrl = 'https://mp-35bd1c1b-8095-44b6-b494-c65e6d85fd9c.cdn.bspapp.com/appConfigure/百度icon.jpg'
				} else if(str.includes('aliyundrive.com')){//阿里云
					map.typeName = '阿里云网盘'
					map.iconUrl = 'https://mp-35bd1c1b-8095-44b6-b494-c65e6d85fd9c.cdn.bspapp.com/appConfigure/阿里icon.jpg '
				} else if(str.includes('pan.quark.cn')){//夸克
					map.typeName = '夸克'
					map.iconUrl = 'https://mp-35bd1c1b-8095-44b6-b494-c65e6d85fd9c.cdn.bspapp.com/appConfigure/夸克icon.jpg'
				} 
				console.log('str==',map.typeName,map.iconUrl)
				
				return map
			}
		},
		}
</script>

<style lang="scss" scoped>
	.baseViewPadding{
		padding: 10px 20px;
	}
	
	.lineView{
		width: 100%;
		height: 1rpx;
	}
	
</style>